import { Component, OnInit } from '@angular/core';
import { MemberVo } from 'src/app/model/member-vo';
import { MemberStorageService } from 'src/app/services/member-storage.service';

@Component({
  selector: 'app-navbar-member-panel',
  templateUrl: './navbar-member-panel.component.html',
  styles: [`
  #member-top-menu{z-index:1041;}
  a.dropdown-item{font-size:.9rem}
  a.dropdown-item span{margin-right:.9rem;font-size:1.138rem}
  `]
})
export class NavbarMemberPanelComponent implements OnInit {
  //是否在线
  public onlined:boolean = false;
  //显示头像
  public avatar:string = '';

  constructor(private memberStorage: MemberStorageService) { }

  ngOnInit(): void {
    let curMember: MemberVo | null = this.memberStorage.get();
    if(null !== curMember){
      this.onlined = true;
    }
    this.avatar = this.memberStorage.decodeLocalAvatar(curMember?.avatar??'') ?? 'assets/avatar/default.png';
  }

}
